package sv.com.renacempleo.dao.ciuo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;

import sv.com.renacempleo.dao.BaseDaoImpl;
import sv.com.renacempleo.dto.ciuo.CIUO_01;
import sv.com.renacempleo.exception.WebException;

public class CIUO_01DaoImpl extends BaseDaoImpl implements CIUO_01Dao{

	@SuppressWarnings("unchecked")
	@Override
	public List<Object[]> findAllAsArray() throws WebException {
		DetachedCriteria criteria = DetachedCriteria.forClass(CIUO_01.class);
		criteria.addOrder(Order.asc("ciuo01Codigo"));
		criteria.setProjection(Projections.projectionList().
			add(Projections.property("ciuo01Codigo")).
			add(Projections.property("ciuo01Nombre"))
		);
		return (List<Object[]>) findByCriteria(criteria);
	}

}
